﻿
function loadFCK(){
    fck.Config["CustomConfigurationsPath"] = "/modules/forms/mail_message/fck.config.js";
    fck.Width = 500;
    fck.Height = 400;
    fck.ToolbarSet = "PluginTest";
    fck.ReplaceTextarea() ;
    
    /* Set Template */
    $("form-container").getElement("form select[name=template-id]").addEvent("change", function(el){
        var templateId = parseInt(this[this.selectedIndex].value);
        console.log(templateId);
        var WS = ExtraClub.Web.Forms.Service.mail_message;
        WS.GetTemplate(templateId, function(resoponse){
            console.log(resoponse);
            var fckAPI = FCKeditorAPI.GetInstance(message);
            fckAPI.SetHTML(resoponse);
        });
    });
}
